﻿using SFML.System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MarzTargetCode
{
    public class Coord
    {
        public Coord(double x, double y)
        {
            this.X = x;
            this.Y = y;
        }
        public Coord()
        {
        }

        public double Y { get; set; }
        public double X { get; set; }

        /// <summary>
        /// Overloading for the plus operator.
        /// </summary>
        /// <param name="c1"></param>
        /// <param name="c2"></param>
        /// <returns>New coordinates</returns>
        public static Coord operator +(Coord c1, Coord c2)
        {
            Coord c3 = new Coord() { X = (c1.X + c2.X), Y = (c1.Y + c2.Y) };

            return c3;
        }

        /// <summary>
        /// Overloading for the minus operator.
        /// </summary>
        /// <param name="c1"></param>
        /// <param name="c2"></param>
        /// <returns>New coordinates</returns>
        public static Coord operator -(Coord c1, Coord c2)
        {
            Coord c3 = new Coord() { X = (c1.X - c2.X), Y = (c1.Y - c2.Y) };
            return c3;
        }
        public static Coord operator *(Coord c1, Coord c2)
        {
            Coord c3 = new Coord() { X = (c1.X * c2.X), Y = (c1.Y * c2.Y) };
            return c3;
        }
        public static Coord operator /(Coord c1, Coord c2)
        {
            Coord c3 = new Coord() { X = (c1.X / c2.X), Y = (c1.Y / c2.Y) };
            return c3;
        }
        public static Coord operator %(Coord c1, Coord c2)
        {
            Coord c3 = new Coord() { X = (c1.X % c2.X), Y = (c1.Y % c2.Y) };
            return c3;
        }
        public static bool operator ==(Coord c1, Coord c2)
        {
            return (c1.X == c2.X) && (c1.Y == c2.Y);
        }
        public static bool operator !=(Coord c1, Coord c2)
        {
            return (c1.X != c2.X) && (c1.Y != c2.Y);
        }

        public override string ToString()
        {
            return string.Format("({0}, {1})", X, Y);
        }
    }
}
